package org.springblade.modules.mes.action;

import org.springblade.modules.opcua.action.OpcDataSaveFactory;
import org.springblade.modules.opcua.model.OpcTargetBean;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @Version 1.0
 */
@Service
public class OpcDataSaveService implements OpcDataSaveFactory {


    @Override
    public Runnable create(OpcTargetBean bean, Map<String, Object> dataMap) {
        if (bean.getDbDriver().indexOf("sqlserver") > 0) {
            //异步保存
            return new JhSqlServerTaker(bean, dataMap);
        } else {
            //异步保存
            return new JhMysqlTaker(bean, dataMap);
        }

    }
}

